'\" t
.\"     Title: ne_redirect_register
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 23 November 2024
.\"    Manual: neon API reference
.\"    Source: neon 0.34.0
.\"  Language: English
.\"
.TH "NE_REDIRECT_REGISTER" "3" "23 November 2024" "neon 0.34.0" "neon API reference"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ne_redirect_register, ne_redirect_location \- HTTP request redirect handling
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <ne_redirect\&.h>
.fi
.ft
.HP \w'void\ ne_redirect_register('u
.BI "void ne_redirect_register(ne_session\ *" "sess" ");"
.HP \w'const\ ne_uri\ *ne_redirect_location('u
.BI "const ne_uri *ne_redirect_location(ne_session\ *" "sess" ");"
.SH "DESCRIPTION"
.PP
The
\fBne_redirect_register\fR
function registers redirect handling for the session\&. If a valid redirect (with status code 3xx) response is processed, the request will fail with the
NE_REDIRECT
error code\&. The destination of the redirect can then be retrieved using
\fBne_redirect_location\fR\&.
.PP
If a redirect was processed, the
\fBne_redirect_location\fR
function returns the destination URI of the redirect\&.
.SH "RETURN VALUE"
.PP
\fBne_redirect_location\fR
returns
NULL
if no request has yet been processed, if the current request was not a redirect, or if the destination of the redirect could not be parsed or resolved\&. Otherwise it returns a pointer to an
\fBne_uri\fR
object, which remains valid until another request is created for the session\&.
.SH "SEE ALSO"
.PP
ne_session_create\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2001-2024 Joe Orton
.br
